const MyPromise = require('./myPromise')

let promise =  new MyPromise((resolve, reject) => {
  // setTimeout(() => {
  //   resolve('成功')
  // },2000)
  resolve('成功')
  reject('失败')
})

promise.then(value => {
  console.log(value);
  throw new Error('then error')
},reason => {
  console.log(reason);
}).then(value => {
    console.log(value)
}, reason => {
    //then前一个错误在这显示
    console.log(aa)
    console.log(reason);
})